<script setup lang="ts">
import { getAlarmList } from '@/api/alarm';
import type { Alarm } from '@/api/alarm/type';
import { onMounted, ref } from 'vue';

const alarmList = ref([] as Alarm[]);

onMounted(() => {
    getAlarmList().then((res) => {
        alarmList.value = res.data;
    })
})
</script>

<template>
    <div class="content">
        <el-table :data="alarmList" style="width: 100%" stripe border>
            <el-table-column prop="id" label="告警ID" />
            <el-table-column prop="deviceId" label="告警机器ID" />
            <el-table-column prop="content" label="告警内容" />
            <el-table-column prop="created" label="创建时间" />
        </el-table>
    </div>
</template>

<style lang="scss" scoped>
.content {
    overflow-y: scroll;
    height: 100%;
}
</style>